In [1]:
import numpy as np
import matplotlib.pyplot as plt

Plotting contour plot of biased FES


In [2]:
%matplotlib inline 

#read the data in from a text file 
fesdata = np.genfromtxt('FULLfes.dat',comments='#');
dim1=100
dim2=100

fesdata = fesdata[:,0:3]
enertokcal=1/627.5095
bhrtonm=0.0529177249

#some post-processing to be compatible with contourf 
X=np.reshape(fesdata[:,0],[dim1,dim2],order="F")  #order F was 20% faster than A/C
Y=np.reshape(fesdata[:,1],[dim1,dim2],order="F") 
Z=np.reshape((fesdata[:,2]-np.min(fesdata[:,2]))/enertokcal,[dim1,dim2],order="F")  #convert to kcal/mol


#what spacing do you want?  
spacer=1.0
lines=11 #this goes to 80 kcal/mol (2*40)
levels=np.linspace(0,lines*spacer,num=(lines+1),endpoint=True)

fig=plt.figure(figsize=(10,8)) 
axes = fig.add_subplot(111)

plt.contourf(X*bhrtonm, Y*bhrtonm, Z, levels, cmap=plt.cm.bone,)
plt.colorbar()
plt.xlabel('$d1$')
plt.ylabel('$d2$')
axes.set_ylim([.15,.45])
axes.set_xlim([0.15,0.45])
plt.rcParams.update({'font.size': 12})
plt.show()



In [28]:
%matplotlib inline 

#read the data in from a text file 
fesdata = np.genfromtxt('pes.BLYP.dat.test',comments='#');
dim1=50
dim2=50

fesdata = fesdata[:,0:3]
enertokcal=1.0 
bhrtonm=0.0529177249

#some post-processing to be compatible with contourf 
X=np.reshape(fesdata[:,0],[dim1,dim2],order="F")  #order F was 20% faster than A/C
Y=np.reshape(fesdata[:,1],[dim1,dim2],order="F") 
Z=np.reshape((fesdata[:,2]-np.min(fesdata[:,2]))/enertokcal,[dim1,dim2],order="F")  #convert to kcal/mol


#what spacing do you want?  
spacer=1.0
lines=10 #this goes to 80 kcal/mol (2*40)
levels=np.linspace(0,lines*spacer,num=(lines+1),endpoint=True)

fig=plt.figure(figsize=(10,8)) 
axes = fig.add_subplot(111)

plt.contourf(X*bhrtonm, Y*bhrtonm, Z, levels, cmap=plt.cm.bone,)
plt.colorbar()
plt.xlabel('$d1$')
plt.ylabel('$d2$')
axes.set_ylim([.15,.45])
axes.set_xlim([0.15,0.45])
plt.rcParams.update({'font.size': 12})
plt.show()



In [ ]: